<%@ tag language="java" pageEncoding="UTF-8" body-content="scriptless" trimDirectiveWhitespaces="true"%>
<%@ attribute name="id" type="java.lang.String" required="true" description="列定义集id" %>
<div id="${id}" style="display:none">
	<jsp:doBody/>
</div>
<script type="text/javascript">
(function(){
	Logger.info("正在初始化 data set: ${id} ...");
	var id = "${id}";
	if(id == 'undefined' || id == '' ){
		Logger.error("请指定列定义集id，数据表格初始化将会根据id进行匹配");
		
	}
	var cols = window[id] = new ColsDef(id);
	var length = $("#"+id).children("label").length;
	for(var i=0;i<length;i++ ){
		var nowCol = $("#"+id).children("label:eq("+i+")");
		var name = nowCol.attr("data-name");
		var display = nowCol.attr("data-display");
		var width = nowCol.attr("data-width")==""?'auto':nowCol.attr("data-width");
		var ignore = nowCol.attr("data-ignore")==""?false:(nowCol.attr("data-ignore")=="false");
		var flex = nowCol.attr("data-flex")==""?false:nowCol.attr("data-flex")=="true";
		var type = nowCol.attr("data-type")==""?'String':nowCol.attr("data-type");
		var sort = nowCol.attr("data-sort")==""?true:nowCol.attr("data-sort")=="true";
		var cssClass = nowCol.attr("data-cssClass");
		var dataCssClass = nowCol.attr("data-dataCssClass")==""?cssClass:nowCol.attr("data-dataCssClass");
		var col = new Col(name,display,width,ignore,flex,type,sort,cssClass,dataCssClass);
		cols.addCol(col);
	}
	Logger.info("data set: ${id} 加载完毕");
})();
</script>
